package com.lizk.study.netty.day002;

import com.lizk.study.netty.entity.ServerContent;
import com.lizk.study.netty.utils.NettyUtils;
import io.netty.channel.ChannelFuture;
import io.netty.channel.socket.nio.NioServerSocketChannel;

/**
 * @author lizhikui
 * @date 2019/6/14 9:25
 */
public class MyServer {
    public static void main(String[] args) throws InterruptedException {
        ServerContent content = NettyUtils.createServerContent(NioServerSocketChannel.class);
        content.getServerBootstrap().childHandler(new MyServerInitializer());

        try {
            NettyUtils.bind(content,9999);
        }finally {
            NettyUtils.stop(content);
        }

    }
}
